package com.cloud.pole.shop.biz.shops;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.shops.ShopShopsFansMapper;
import com.cloud.pole.shop.model.entity.shops.ShopShopsFans;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopShopsFansBiz extends BaseBiz<ShopShopsFansMapper, ShopShopsFans> {
	
	@Cache(key="shopShopsFans{1}-shopId-fans{2}-openId")
    public ShopShopsFans selectByShopIdAndOpenId(Integer shopId, String openId) {
		ShopShopsFans fans = new ShopShopsFans();
		fans.setShopId(shopId);
		fans.setOpenId(openId);	
		 return mapper.selectOne(fans);
    }
	
	@Override 
    @CacheClear(key= "shopShopsFans{1.shopId}-shopId-fans{1.openId}-openId")
	public void insertSelective(ShopShopsFans record) {
		super.insertSelective(record);
	}
	
	@Override 
    @CacheClear(key= "shopShopsFans{1.shopId}-shopId-fans{1.openId}-openId")
	public void updateSelectiveById(ShopShopsFans record) {
        mapper.updateByPrimaryKeySelective(record);
	}
}
